#!/bin/sh
# ------------------------------------------------------------------------
# FDSProxy start with console
# ------------------------------------------------------------------------

if [ -z "$FDSPROXY_HOME" ] ; then

  ## resolve links - $0 may be a link to fdsproxy's home
  PRG="$0"

  # need this for relative symlinks
  dirname_prg=`dirname "$PRG"`

  while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '.*/.*' > /dev/null; then
      PRG="$link"
    else
      PRG=`dirname "$PRG"`"/$link"
    fi
  done

  FDSPROXY_HOME=`dirname "$PRG"`
  cd "$FDSPROXY_HOME"
fi

exec $FDSPROXY_HOME/fdsproxy $@